]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
workspaceAnimation: Fix warning on restacking
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 22 Feb 2022 20:16:52 +0000 (21:16 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 23 Feb 2022 12:29:36 +0000 (12:29 +0000)
Only workspace groups that are associated with a workspace have a
background. As a result, when restacking window previews we end up
passing `undefined` to clutter_actor_set_child_above_sibling()
instead of null, triggering a warning.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2209>

js/ui/workspaceAnimation.js

index f61afe323b152d70837976b04419dedf3a20a8a6..25144ab3ac5eb70b182fdce5ff05b0ee986b70d4 100644 (file)
@@ -73,11 +73,13 @@ class WorkspaceGroup extends Clutter.Actor {
             this._shouldShowWindow(w.meta_window));
 
         let lastRecord;
+        const bottomActor = this._background ?? null;
 
         for (const windowActor of windowActors) {
             const record = this._windowRecords.find(r => r.windowActor === windowActor);
 
-            this.set_child_above_sibling(record.clone, lastRecord ? lastRecord.clone : this._background);
+            this.set_child_above_sibling(record.clone,
+                lastRecord ? lastRecord.clone : bottomActor);
             lastRecord = record;
         }
     }